#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
const int maxn = 1000100;
string s; 
int l;
int nxt[maxn];
void gnext() {
    nxt[0] = 0;
    for (int i = 1; i < s.length(); i++) {
        int j = nxt[i - 1];
        while (j > 0 && s[i] != s[j]) j = nxt[j - 1];
        if (s[i] == s[j]) j++;
        nxt[i] = j;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> l;
    cin >> s;
    gnext();
    cout << s.length() - nxt[l - 1] << endl;
    return 0;
}
